ambient25 2.2.0
Loading...
Searching...
No Matches
Ambient 25 Click Driver

API for configuring and manipulating Ambient 25 Click driver. More...

Topics

 Ambient 25 Registers List
 List of registers of Ambient 25 Click driver.
 Ambient 25 Registers Settings
 Settings for registers of Ambient 25 Click driver.
 Ambient 25 MikroBUS Map
 MikroBUS pin mapping of Ambient 25 Click driver.

Functions

void ambient25_cfg_setup (ambient25_cfg_t *cfg)
 Ambient 25 configuration object setup function.
err_t ambient25_init (ambient25_t *ctx, ambient25_cfg_t *cfg)
 Ambient 25 initialization function.
err_t ambient25_default_cfg (ambient25_t *ctx)
 Ambient 25 default configuration function.
err_t ambient25_write_regs (ambient25_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Ambient 25 write regs function.
err_t ambient25_read_regs (ambient25_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Ambient 25 read regs function.
err_t ambient25_write_reg (ambient25_t *ctx, uint8_t reg, uint8_t data_in)
 Ambient 25 write reg function.
err_t ambient25_read_reg (ambient25_t *ctx, uint8_t reg, uint8_t *data_out)
 Ambient 25 read reg function.
err_t ambient25_write_reg_word (ambient25_t *ctx, uint8_t reg, uint16_t data_in)
 Ambient 25 write reg word function.
err_t ambient25_read_reg_word (ambient25_t *ctx, uint8_t reg, uint16_t *data_out)
 Ambient 25 read reg word function.
err_t ambient25_check_communication (ambient25_t *ctx)
 Ambient 25 check communication function.
void ambient25_enable_device (ambient25_t *ctx)
 Ambient 25 enable device function.
void ambient25_disable_device (ambient25_t *ctx)
 Ambient 25 disable device function.
void ambient25_set_vsync_pin (ambient25_t *ctx, uint8_t state)
 Ambient 25 set vsync pin state function.
uint8_t ambient25_get_int_pin (ambient25_t *ctx)
 Ambient 25 get int pin state function.
err_t ambient25_soft_reset (ambient25_t *ctx)
 Ambient 25 soft reset function.
err_t ambient25_clear_fifo (ambient25_t *ctx)
 Ambient 25 clear fifo function.
err_t ambient25_read_fifo_size (ambient25_t *ctx, uint16_t *fifo_size)
 Ambient 25 read fifo size function.
err_t ambient25_read_data (ambient25_t *ctx, ambient25_data_t *data_out)
 Ambient 25 read data function.

Detailed Description

API for configuring and manipulating Ambient 25 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ ambient25_cfg_setup()

void ambient25_cfg_setup ( ambient25_cfg_t * cfg)

Ambient 25 configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See ambient25_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ ambient25_check_communication()

err_t ambient25_check_communication ( ambient25_t * ctx)

Ambient 25 check communication function.

This function checks the communication by reading and verifying the device ID.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient25_clear_fifo()

err_t ambient25_clear_fifo ( ambient25_t * ctx)

Ambient 25 clear fifo function.

This function clears the FIFO buffers and interrupts.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient25_default_cfg()

err_t ambient25_default_cfg ( ambient25_t * ctx)

Ambient 25 default configuration function.

This function executes a default configuration of Ambient 25 Click board.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ ambient25_disable_device()

void ambient25_disable_device ( ambient25_t * ctx)

Ambient 25 disable device function.

This function enables the device by setting the EN pin to LOW logic state.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ambient25_enable_device()

void ambient25_enable_device ( ambient25_t * ctx)

Ambient 25 enable device function.

This function enables the device by setting the EN pin to HIGH logic state.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ambient25_get_int_pin()

uint8_t ambient25_get_int_pin ( ambient25_t * ctx)

Ambient 25 get int pin state function.

This function returns the INT pin logic state.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ambient25_init()

err_t ambient25_init ( ambient25_t * ctx,
ambient25_cfg_t * cfg )

Ambient 25 initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See ambient25_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See ambient25_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient25_read_data()

err_t ambient25_read_data ( ambient25_t * ctx,
ambient25_data_t * data_out )

Ambient 25 read data function.

This function checks if the als measurement data are ready for all channels and reads them.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
[out]data_out: ALS measurements data object. See ambient25_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient25_read_fifo_size()

err_t ambient25_read_fifo_size ( ambient25_t * ctx,
uint16_t * fifo_size )

Ambient 25 read fifo size function.

This function reads the number of data bytes available to read from FIFO.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
[out]fifo_size: Number of data bytes available to read from FIFO.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient25_read_reg()

err_t ambient25_read_reg ( ambient25_t * ctx,
uint8_t reg,
uint8_t * data_out )

Ambient 25 read reg function.

This function reads data from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient25_read_reg_word()

err_t ambient25_read_reg_word ( ambient25_t * ctx,
uint8_t reg,
uint16_t * data_out )

Ambient 25 read reg word function.

This function reads a data word starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data word.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient25_read_regs()

err_t ambient25_read_regs ( ambient25_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Ambient 25 read regs function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient25_set_vsync_pin()

void ambient25_set_vsync_pin ( ambient25_t * ctx,
uint8_t state )

Ambient 25 set vsync pin state function.

This function sets the VSYNC pin state.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ ambient25_soft_reset()

err_t ambient25_soft_reset ( ambient25_t * ctx)

Ambient 25 soft reset function.

This function executes the defice software reset command.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient25_write_reg()

err_t ambient25_write_reg ( ambient25_t * ctx,
uint8_t reg,
uint8_t data_in )

Ambient 25 write reg function.

This function writes a desired data to the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient25_write_reg_word()

err_t ambient25_write_reg_word ( ambient25_t * ctx,
uint8_t reg,
uint16_t data_in )

Ambient 25 write reg word function.

This function writes a data word starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data word to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ambient25_write_regs()

err_t ambient25_write_regs ( ambient25_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Ambient 25 write regs function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See ambient25_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.